package fightplan.ui;

import java.awt.Component;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

import fightplan.core.IconProvider;

@SuppressWarnings("serial")
public class IconProviderRenderer extends DefaultTableCellRenderer {

	public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
			int row, int column) {
		super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
		IconProvider provider = (IconProvider) value;
		setIcon(provider.getIcon());
		return this;
	}

}
